#include<iostream>
using namespace std;

const int N = 100010;
int a[N], b[N];

int n, m, l, r, c;

int main(){
    scanf("%d%d", &n, &m);
    a[0] = 0;
    for(int i = 1; i <= n; i++){
        scanf("%d", &a[i]);
        b[i] += a[i];
        b[i + 1] -= a[i];
    }
    //生成差分数组
    while(m--){
        scanf("%d%d%d", &l, &r, &c);
        b[l] += c;
        b[r + 1] -=c;
    }
    //对数组b求前缀和，使得数组b变为改变后的数组a
    for(int i = 1; i <= n; i++){
        b[i] += b[i - 1];
        printf("%d ", b[i]);
    }
    return 0;
}

